class StorageHelper {
    // 主界面tab
    setTabVisitedList(tabVisitedList) {
      window.sessionStorage.setItem(
        'tabVisitedList',
        JSON.stringify(tabVisitedList)
      )
    }
    getTabVisitedList() {
      let tabVisitedList = JSON.parse(
        window.sessionStorage.getItem('tabVisitedList')
      )
      return tabVisitedList || []
    }
    removeTabVisitedList() {
      window.sessionStorage.removeItem('tabVisitedList')
    }
    setUserInfo(userInfo) {
      window.sessionStorage.setItem('userInfo', JSON.stringify(userInfo))
    }
    getUserInfo() {
      let userInfo = JSON.parse(window.sessionStorage.getItem('userInfo'))
      return userInfo || ''
    }
    getToken() {
      let token =window.sessionStorage.getItem('token')
      return token || ''
    }
    setToken(token) {
      window.sessionStorage.setItem('token', token)
    }
   
    setGroupValue(groupValue) {
      window.sessionStorage.setItem('groupValue', groupValue)
    }
    getGroupValue() {
      return window.sessionStorage.getItem('groupValue') || ''
    }
    setValue(name,key){
      window.sessionStorage.setItem(name, JSON.stringify(key))
    }
    getValue(name){
      return JSON.parse(window.sessionStorage.getItem(name)) || ''
    }
    delValue(name){
      window.sessionStorage.removeItem(name)
    }
  }
  
  let storageHelper = new StorageHelper()
  
  export default storageHelper
  